<template>
  <div class="box">
    <div class="login">
      <div class="logo">
        <img src="../../assets/img/logo.svg" alt="" />
      </div>
      <div class="btn">
        <van-button type="primary" block class="iphone" @click="iphoneClick"
          >手机登入</van-button
        >
        <van-button type="primary" block @click="homeClick"
          >立即体验</van-button
        >
      </div>
      <div class="icon-item">
        <van-icon name="gem" color="#fff" />
        <van-icon name="service" color="#fff" />
        <van-icon name="refund-o" color="#fff" />
        <van-icon name="setting-o" color="#fff" />
      </div>

      <p>
        <input
          type="checkbox"
          v-model="isChecked"
        />同意《用户协议》和《隐私政策》
      </p>
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  name: 'login',
  data () {
    return {
      isChecked: false
    }
  },
  methods: {
    iphoneClick () {
      if (!this.isChecked) {
        Toast.fail('请先勾选用户协议')
      } else {
        this.$router.push({ path: '/cellphone' })
      }
    },
    homeClick () {
      if (!this.isChecked) {
        Toast.fail('请先勾选用户协议')
      } else {
        this.$router.push({ path: '/home' })
      }
    }
  }
}
</script>

<style scoped>
.box {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #cc3333;
}
.logo {
  height: 40px;
  width: 40px;
  margin: 142px auto;
}
.van-button {
  margin-bottom: 20px;
  width: 280px;
  margin: 20px auto;
  height: 30px;
  border-radius: 20px;
  background-color: #fff;
  border: 0;
  color: #cc3333;
}
.icon-item {
  text-align: center;
  display: flex;
}
.icon-item i {
  flex: 1;
  font-size: 30px;
}
p {
  font-size: 16px;
  color: #fff;
  text-align: center;
  height: 200px;
}
</style>
